package project.model;

import java.text.ParseException;
import java.util.ArrayList;

import project.controllers.workers.WorkerWithFile.WorkerWithFile;
import textFileWorkerWrapper.*;

public class DataBase {
	
	WorkerWithFile wwf ;

	public DataBase(String masPath, String ordPath, String garPath){
		wwf = new WorkerWithFile(masPath, ordPath, garPath);
		
	}

	public ArrayList<IMaster> getMasterList() {
		return wwf.getListMastersFromFile();
	}

	public ArrayList<IGarage> getGarageList() {
		return wwf.getListGaragesFromFile();
	}

	public ArrayList<IOrder> getOrderList() throws NumberFormatException, ParseException {
		return wwf.getOrderFromFile();
	}

	
	public void saveGarageListToBD(ArrayList<IGarage> gar){
		wwf.saveGarageList(gar);
	}
	
	public void saveOrderListToBD(ArrayList<IOrder> ord){
		wwf.saveOrderList(ord);
	}
	
	public void saveMasterListToBD(ArrayList<IMaster> mas){
		wwf.saveMasterList(mas);
	}
	
}
